package br.com.orion.sga.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import br.com.orion.sga.exception.DaoException;
import br.com.orion.sga.model.dao.AlunoDao;
import br.com.orion.sga.model.entities.Aluno;

@Service
public class AlunoService {
	
	@Autowired
	private AlunoDao alunoDao;
	
	public void save(Aluno aluno) throws DaoException{
		alunoDao.save(aluno);
	}
	
	public List<Aluno> listAll(){
		return alunoDao.listAll();
	}
	
	/**
	 * 
	 * @param cpf
	 * @return
	 * @throws DaoException
	 */
	public Aluno getByCPF(String cpf) throws DaoException{
		return alunoDao.getByCPF(cpf);
	}
	
	/**
	 * 
	 * @param idAluno
	 * @return
	 */
	public Aluno getById(Long idAluno) {
		return alunoDao.getById(idAluno);
	}
	
	
	public void delete(Aluno aluno) throws DaoException {
		alunoDao.delete(aluno);
	}
	
	
	public void update(Aluno aluno) throws DaoException {
		alunoDao.update(aluno);
	}
}
